home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / DOCS.ZIP / PT.MAN < prev    next >
Text File  |  1992-09-20  |  3KB  |  100 lines

  1. PT
  2.  
  3.  
  4. NAME
  5.      pt - canonical LR(1) parse (action and goto) table generator.
  6.           The input grammar productions with added enumerations,
  7.             needed as part of the reduction in the action
  8.             table, is also part of the output.
  9.           (Various optional outputs are possible:-
  10.             terminal sets
  11.             nonterminal sets
  12.             first sets for nonterminals
  13.             items in each state)
  14.  
  15. SYNOPSIS
  16.      pt [ option | option | ... ]
  17.  
  18. DESCRIPTION
  19.      Pt reads the grammar from the file called grammar, if one exists,
  20.      else it will read from standard input.  The grammar MUST conform
  21.      to the following:-
  22.  
  23.     1.  It must be a context-free grammar, augmented or unaugmented.
  24.         2.  Each production is of the form:-
  25.  
  26.                    A -> B ; C a 
  27.  
  28.         The arrow separates the left side of the production
  29.             from the right side.
  30.         The left side of the production consists of only one
  31.             nonterminal.
  32.         The right side of the production consists of a sequence
  33.             of symbols (terminals, nonterminals) with one or 
  34.             more white spaces (blanks and tabs) separating them.
  35.         A symbol is thus either a terminal or a nonterminal but
  36.             not both.
  37.         
  38.     3.  One production per line; no alternation allowed.  Thus, 
  39.         represent the following 2 productions:-
  40.  
  41.                    A -> B ; C a   |   b
  42.         by:-
  43.                    A -> B ; C a 
  44.                 A -> b
  45.     
  46.     4.  Newline character, tab and blank cannot be a grammar token
  47.         (terminal or nonterminal).
  48.  
  49.     5.  The left hand side symbol of the very first production
  50.         represents the starting symbol of the grammar.
  51.  
  52.     6.  The following are "reserved" words:-
  53.  
  54.                 START
  55.                 EOI
  56.  
  57.         and cannot be used as a terminal or nonterminal.
  58.  
  59.     7.  EPSILON is considered another "reserved" word and can be
  60.         used to represent an empty production, viz.
  61.                 
  62.                 H -> EPSILON
  63.  
  64.     No error messages will be issued if the input grammar does not
  65.          conform to the above specifications.
  66.  
  67.      The options, which can appear in any order, are:-
  68.  
  69.     -t    Print the list of terminals in the grammar.
  70.  
  71.     -nt    Print the list of nonterminals in the grammar.
  72.  
  73.     -f    Print the list of first sets of the nonterminals 
  74.         in the grammar.
  75.  
  76.     -e    Print the list of items (i.e. closure) in each state.
  77.  
  78.  
  79. FILES
  80.      grammar          grammar file with format specified above.
  81.  
  82. SEE ALSO
  83.      yacc
  84.      Aho A.V., Sethi, R. and Ullman, J.D., Compilers: Principles,
  85.     Techniques, and Tools.  Addison-Wesley, 1986.
  86.  
  87. DIAGNOSTICS
  88.      All shift/reduce conflicts will be reported (to errout).  In the 
  89.         table form, only shift will be shown.
  90.      To avoid reduce/reduce conflict the grammar should be unambiguous 
  91.     with left-factoring performed if necessary.
  92.      Unrecognized options or arguments in the command line will be
  93.         ignored.
  94.  
  95. BUGS
  96.      No known bugs!
  97.  
  98. AUTHOR
  99.      Deeporn H. Beardsley
  100.